<template>
  <div class="box">
    <div class="logo">
      <img src="../../assets/img/logo.png" alt="" />
    </div>
    <div class="searchBox">
      <el-input placeholder="输入关键词搜索" v-model="input" clearable>
        <el-button
          slot="append"
          icon="el-icon-search"
          @click="search(input)"
        ></el-button>
      </el-input>
    </div>
    <div class="muisc"></div>
    <div class="user">
      <el-avatar
        src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
      ></el-avatar>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      input: "",
    };
  },
  methods: {
    search(input) {
      this.$router.push({ name: "search", query: { key: input } });
    }
  },
 
};
</script>

<style scoped>
.box {
  position: fixed;
  z-index: 99;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 1400px;
  height: 100px;
  background-color: #424753;
}
.searchBox {
  width: 400px;
}
.user {
  width: 200px;
}
</style>